<?php
namespace app\home\controller;

use app\BaseController;
use think\facade\View;
use app\home\model\Hezuo as ModelHeZuo;
use app\home\model\Seo;
use app\api\model\Usage;



class HeZuo extends BaseController
{
    public function index()
    {
        View::assign('kw', Seo::getKeywords());
        View::assign('desc', Seo::getDesc());
        $usage = new Usage;
        $usage->save([
            'access_page'=>'Other',
            'access_time'=>date('Y-m-d', time()),
            'access_ip'=>$_SERVER["REMOTE_ADDR"]
        ]);
        return View::fetch();
    }
    public function add()
    {
        $hezuo = new ModelHeZuo();
        $hezuo->allowField(['shop_name','mail_sall', 'resume', 'company', 'local', 'web', 'wechat_public', 'name', 'phone', 'wechat'])->save($_POST);
        return $hezuo->id;
    }
}
